<!DOCTYPE HTML>
<html lang="vi">
<head>
    <meta charset="UTF-8">
    <title>{{ Config::get('application.name') }} | {{ $pageTitle }}</title>
    {{ HTML::style('css/normalize.css') }}
    {{ HTML::style('css/style.css') }}
    @if (Request::env() == 'local')
    <script type="text/javascript" src="{{ asset('js/jquery-1.9.0.min.js') }}"></script>
    @else
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
    @endif
    {{ HTML::script('js/underscore-min.js') }}
</head>
<body>

<div id="loading-bar">
    <img src="{{ asset('img/loading.gif') }}" alt="loading">
</div>

<div id="go-top">
    <img src="{{ asset('img/up.png') }}" alt="go top">
</div>

<div id="main" role="main">
    <aside class="box">
        <div id="sidebar-inner" class="box-inner">
            <header>
                <a href="{{ url('/') }}">
                    <h1>

                        {{ Config::get('application.name') }}

                    </h1>
                </a>
            </header>
            <nav>
                <ul id="main-nav">
                    <li><a href="{{ url('/') }}">{{ __('nav.homepage') }}</a></li>
                    <li><a href="{{ action('user@channels') }}">{{ __('nav.channel') }}</a></li>
                    <li><a href="{{ action('user@collections') }}" id="collection-select-sheller">{{ __('label.collection.select-more') }}</a></li>
                </ul>
            </nav>

            @if (Auth::check())
            <div class="sidebar-box">
                <!--
                <h2>Function</h2>
                <div class="sidebar-box-content">
                    <p>sidebar-box-content</p>
                    <p>sidebar-box-content</p>
                    <p>sidebar-box-content</p>
                    <p>sidebar-box-content</p>
                    <p>sidebar-box-content</p>
                </div>
                -->
                @yield('page-functions')
            </div>

            @endif <!-- is logged? -->

            <div class="sidebar-box" id="user-panel">
                <h2>{{ __('m.user') }}</h2>
                <div class="sidebar-box-content">
                    @if (Auth::guest())
                    <a href="{{ action('user@login') }}" class="login">
                        <h3>{{ __('m.login.require') }}</h3>
                    </a>
                    @else
                    <h3>
                        {{ __('m.welcome') }} <strong>{{ Auth::user()->username }}</strong>
                        <a href="{{ action('user@logout') }}" class="logout">{{ __('m.logout') }}</a>
                    </h3>
                    @endif
                </div>
            </div>
        </div>
    </aside>

    <div id="content" class="box">
        <div class="box-inner">
            <h2>{{ $pageTitle }}</h2>

            @yield('page-content')
        </div>
    </div>
</div> <!-- close #main -->

<div style="clear:both;"></div>
<footer>
    <div id="footer-inner">
        Copyright &copy; 2013 - <a href="http://mientaysoft.com" target="_blank">MienTaySoft</a> | Designed by <a
            href="mailto:pyttop@gmail.com">Pyttop@gmail.com</a>
    </div>
</footer>

{{ HTML::script('js/common.js') }}
</body>
</html>